Execution order in imperative languages

Metadata
aliases: [Imperative languages have fixed execution orders, Execution order in imperative programming languages]
shorthands: {}
created: 2022-07-12 14:52:34
modified: 2022-07-12 14:56:20

In imperative languages, the order in which the commands are executed is crucial most of the time, because commands may depend on previously set values.

Imperative languages have fixed execution orders.

Example

Let's look at a program for swapping X and Y:

T := X;
X := Y;
Y := T;

If we change the order of any two of the commands, the program will not be correct.